package com.lmt.ymcc.web.controller;

import com.lmt.ymcc.dto.VerifyCodeDto;
import com.lmt.ymcc.result.JSONResult;
import com.lmt.ymcc.service.IVerifyCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: TODO
 * @Author: Amazing
 * @Date: 2022/8/6 12:46
 * @Version: 1.0
 */
@RestController
@RequestMapping("/verifycode")
public class VerifyCodeController {

    @Autowired
    private IVerifyCodeService verifyCodeService;

    @PostMapping("/sendSmsCode")
    public JSONResult sendSmsCode(@RequestBody VerifyCodeDto verifyCodeDto) {
        return verifyCodeService.sendSmsCode(verifyCodeDto);
    }

    @GetMapping("/imageCode/{imageCodeKey}")
    public JSONResult imageCodeKey(@PathVariable String imageCodeKey) {
        return verifyCodeService.imageCode(imageCodeKey);
    }
}
